package com.wish.g04.financing.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wish.g04.base.entity.CwCheckBatch;
import com.wish.g04.base.service.ICwCheckBatchService;
import com.wish.g04.common.core.utils.StringUtils;
import com.wish.g04.financing.dto.CheckBatchDTO;
import com.wish.g04.financing.service.CheckBatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 对账批次表 服务实现类
 * </p>
 *
 * @author tyd
 * @since 2022-05-28
 */
@Service
public class CheckBatchServiceImpl implements CheckBatchService {

    @Autowired
    private ICwCheckBatchService checkBatchService;

    /**
     * 对账批次查询
     * @param checkBatchDTO
     * @return
     */
    @Override
    public List<CwCheckBatch> getCheckBatchList(CheckBatchDTO checkBatchDTO) {
        QueryWrapper<CwCheckBatch> wrapper = new QueryWrapper<>();
        //账单日期 区间查询
        if (StringUtils.isNotEmpty(checkBatchDTO.getBillDay())) {
            wrapper.ge("bill_day",checkBatchDTO.getBillDay());
        }
        if (StringUtils.isNotEmpty(checkBatchDTO.getEndBillDay())) {
            wrapper.le("bill_day",checkBatchDTO.getEndBillDay());
        }
        List<CwCheckBatch> cwCheckBatchList = checkBatchService.list(wrapper);
        return cwCheckBatchList;
    }

    @Override
    public void checkAccount() {

    }
}
